import { Body, Controller, Get, Headers, Post } from '@nestjs/common';
import { OssService } from './oss.service';
import { CreateFileDto } from './dto/create-file.dto';
import { Public } from '../common/isPublic';
import { ApiTags } from '@nestjs/swagger';

@Controller('oss')
@Public()
@ApiTags('oss')
export class OssController {
  constructor(private oss: OssService) {}
  @Post()
  uploadLocalFile(@Body() createFileDto: CreateFileDto) {
    return this.oss.uploadLocalFile(createFileDto);
  }

  @Get('signature')
  getOssSignature() {
    return this.oss.getSignature();
  }

  @Post('download')
  download(@Body('filename') filename: string) {
    return this.oss.download(filename);
  }
}
